package com.starhub.application.collection.service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.IService;
import com.starhub.application.collection.entity.KnowledgeCollection;

/**
 * 知识库表服务接口
 * @version: V1.0
 * @author: liuhf
 * @time 2025-06-09
 */
public interface KnowledgeCollectionService extends IService<KnowledgeCollection> {
    
    /**
     * 插入知识库表
     * @param knowledgeCollection
     * @return
     */
    int insert(KnowledgeCollection knowledgeCollection);
    
    /**
     * 更新知识库表
     * @param knowledgeCollection
     * @return
     */
    boolean updateById(KnowledgeCollection knowledgeCollection);
    
    /**
     * 根据标识查询知识库表
     * @param collectionIdentifier
     * @return
     */
    KnowledgeCollection selectByIdentifier(String collectionIdentifier);
    
    /**
     * 根据标识查询知识库表数量
     * @param collectionIdentifier
     * @return
     */
    long countByIdentifier(String collectionIdentifier);
    
    /**
     * 根据ID查询知识库表
     * @param id
     * @return
     */
    KnowledgeCollection selectById(Long id);

    /**
     * 根据ID查询未删除的知识库表
     * @param id
     * @return
     */
    KnowledgeCollection selectByIdAndNotDeleted(Long id);

    /**
     * 根据ID查询未删除的知识库表
     * @param ids
     * @return
     */
    List<KnowledgeCollection> selectBatchIds(List<Long> ids);


    String getDataIdByContent(String content, Long collectionId);

    /**
     * 逻辑删除
     * @param id
     * @return
     */
    int deleteById(Long id);


    /**
     * 物理删除
     * @param id
     * @return
     */
    int deleteRecord(Long id);


    /**
     * 批量查询接口
     * @param params
     * @return
     */
    List<KnowledgeCollection> selectByMap(Map<String, Object> params);

    /**
     * 批量查询接口
     * @param params
     * @return
     */
    List<KnowledgeCollection> getActiveKnowledgeCollection(Map<String, Object> params);
}